import Vue from 'vue';
import VueRouter from 'vue-router';
// 引入
import Home from '@/views/Home'
import Comment from '@/views/Comment'
import Search from '@/views/Search'

//注册
Vue.use(VueRouter)

//分配路由
const routes = [{
        path: '/',
        redirect: '/home',
        meta: {
            title: '首页'
        }
    },
    {
        path: '/home',
        component: Home,
        meta: {
            title: '首页'
        }

    },
    {
        path: '/comment',
        component: Comment,
        meta: {
            title: '评论'
        }
    },
    {
        path: '/search',
        component: Search,
        meta: {
            title: '搜索'
        }
    }
]

const router = new VueRouter({
    routes
})

//导出
export default router